package com.totoro.spring.spring_demo.property;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * Created by Niki on 2018/6/14 15:36
 */
@Component
public class EnvironmentReadProperties {
    @Autowired
    Environment environment;

    public String readAppName() {
        return environment.getProperty("app.name");
    }
}
